module Npc (
    pc,instr,Branch,zero,Jump,npc
);
    input [31:0] pc; //now pc
    input Branch;//is branch if 1
    input zero;// is true if 1
    input Jump;//is jump if 1
    input [25:0] instr;//last 26 digit of instruction
    output reg [31:0] npc;//next pc 
    always @(*) begin
        if(Jump)
            npc = {pc[31:28], {instr[25:0] << 2}};
        else if (Branch&&zero==1)
        begin
            npc =   ({{14{instr[15]}}, instr[15:0]} << 2)  + pc + 4;
        end
        else
            npc = pc+4;
    end
endmodule //npc